<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/demo/expensesrecord/ExpensesRecord.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/demo/expensesrecord/ExpensesRecord.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'ExpensesRecordId',
                footer: "Foots",
                cnName: '费用记录表',
                name: 'expensesrecord/ExpensesRecord',
                url: "/VehicleService/api/ExpensesRecord/",
                sortName: "CreateTime"
            });
            const editFormFields = ref({"ExpensesType":"","CarLicense":"","ExpensesMoney":"","LeaderName":"","Describe":"","UseData":"","Remark":""});
            const editFormOptions = ref([[{"dataKey":"维修类型下拉框","data":[],"title":"费用类型","field":"ExpensesType","type":"select"}],
                              [{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"select"}],
                              [{"title":"金额","field":"ExpensesMoney","type":"decimal"}],
                              [{"dataKey":"上级负责人","data":[],"title":"负责人","field":"LeaderName","type":"select"}],
                              [{"title":"描述","field":"Describe","type":"textarea"}],
                              [{"title":"使用日期","field":"UseData","type":"date"}],
                              [{"title":"备注","field":"Remark","type":"textarea"}]]);
            const searchFormFields = ref({"CarLicense":"","LeaderName":"","UseData":""});
            const searchFormOptions = ref([[{"dataKey":"上级负责人","data":[],"title":"负责人","field":"LeaderName","type":"select"},{"title":"使用日期","field":"UseData","type":"date"},{"dataKey":"车牌号下拉框","data":[],"title":"车牌号","field":"CarLicense","type":"like"}]]);
            const columns = ref([{field:'ExpensesRecordId',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'ExpensesType',title:'费用类型',type:'int',bind:{ key:'维修类型下拉框',data:[]},width:110,align:'left',sort:true},
                       {field:'CarLicense',title:'车牌号',type:'string',bind:{ key:'车牌号下拉框',data:[]},width:110,align:'left'},
                       {field:'ExpensesMoney',title:'金额',type:'decimal',width:110,align:'left'},
                       {field:'LeaderName',title:'负责人',type:'string',bind:{ key:'上级负责人',data:[]},width:110,align:'left'},
                       {field:'Describe',title:'描述',type:'string',width:110,align:'left'},
                       {field:'UseData',title:'使用日期',type:'datetime',width:150,align:'left',sort:true},
                       {field:'Remark',title:'备注',type:'string',width:110,align:'left'},
                       {field:'CreateName',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateName',title:'修改人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'UpdateTime',title:'修改时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDel',title:'逻辑删除',type:'int',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
